# -*- coding:utf-8 -*-
from __future__ import unicode_literals

from django.contrib import admin

from wlmodels.codes.utils import ELBaseAdmin, EntIdableAdmin
from .models import *


class ELFinanceAdmin(ELBaseAdmin):
    list_display = ["id", "entid_id", "ENTNAME", "entid_tax", "id_tax", "region_id", "entertype_tax", "industry_tax", "registertype"]
    list_display_links = ["id", "ENTNAME", ]
    list_filter = ("entertype_tax",)
    search_fields = ("^ENTNAME",)


class ELFinanceTaxAdmin(EntIdableAdmin):
    list_display = ["id", "entid", "year", "revenue", "operation_profit", "total_profit", "assets", "assets_re", "islatest"]
    list_display_links = ["entid", ]
    list_filter = ("year",)
    raw_id_fields = ("entid_tax",)


class ELFinanceIndexAdmin(EntIdableAdmin):
    list_display = ["id", "entid", "year", "gross", "profit_net", "asset_return", "income_increase", "profit_net_increase"]
    list_display_links = ["entid", ]
    list_filter = ("year",)
    raw_id_fields = ("entid_tax",)


class ELFinanceDupAdmin(ELBaseAdmin):
    list_display = ["id", "ENTNAME", "id_tax", "year", "collection_type", "revenue", "total_profit", "B_revenue", "B_sales_cost"]
    list_filter = ("year",)
    search_fields = ("^ENTNAME",)


class ELHGEntAdmin(ELBaseAdmin):
    list_display = ["id", "entid", "entid_hg", "ENTNAME", "nacao_id", ]
    search_fields = ("^ENTNAME",)


class ELHGEntDetailAdmin(EntIdableAdmin):
    list_display = ["id", "entid", "entid_hg", "tmonth", "tport", "scale", ]


class ELHGEntGoodsAdmin(EntIdableAdmin):
    list_display = ["id", "entid", "entid_hg", "tyear"]


class ELHGGoodsDetailAdmin(EntIdableAdmin):
    list_display = ["id", "entid", "entid_hg", "tmonth", "goods", "tport", "scale", ]


class ELHGOriginAdmin(ELBaseAdmin):
    list_display = ["id", "ENTNAME", "tmonth", "goods_name", "tport", "scale", ]
    search_fields = ("^ENTNAME",)


class ELListedAdmin(EntIdableAdmin):
    list_display = ["id", "entid", "sname", "exchange", "hangye", "a_code"]
    list_display_links = ["sname", ]


class ELListedCombasAdmin(EntIdableAdmin):
    list_display = ["id", "entid", "ACCPER", "STKCD", "A001101000", "A001100000", "A0I1210000"]


class ELListedCominsAdmin(EntIdableAdmin):
    list_display = ["id", "entid", "ACCPER", "STKCD", "B001100000", "B001300000", "B002000000"]


class ELListedComscfdAdmin(EntIdableAdmin):
    list_display = ["id", "entid", "ACCPER", "STKCD", "C001001000", "C002007000", "C0I2008000"]


class ELListedComscfiAdmin(EntIdableAdmin):
    list_display = ["id", "entid", "ACCPER", "STKCD", "D000101000", "D000104000", "D000105000"]


class ELListedXinsanAdmin(EntIdableAdmin):
    list_display = ["id", "ENTNAME", "year", "zd0", "zd1", "zd3", "zd4"]
    list_display_links = ["ENTNAME", ]


class ELNacaoAdmin(ELBaseAdmin):
    list_display = ["id", "ENTNAME", "REGNO", "NACAOID", "UNISCID", "NAME"]
    list_display_links = ["ENTNAME", ]
    search_fields = ("^ENTNAME",)


admin.site.register(ELFinance, ELFinanceAdmin)
admin.site.register(ELFinanceTax, ELFinanceTaxAdmin)
admin.site.register(ELFinanceIndex, ELFinanceIndexAdmin)
admin.site.register(ELFinanceDup, ELFinanceDupAdmin)
admin.site.register(ELHGEnt, ELHGEntAdmin)
admin.site.register(ELHGEntDetail, ELHGEntDetailAdmin)
admin.site.register(ELHGGoodsDetail, ELHGGoodsDetailAdmin)
admin.site.register(ELHGOrigin, ELHGOriginAdmin)
admin.site.register(ELHGEntGoods, ELHGEntGoodsAdmin)
# admin.site.register(ELListed, ELListedAdmin)
# admin.site.register(ELListedCombas, ELListedCombasAdmin)
# admin.site.register(ELListedComins, ELListedCominsAdmin)
# admin.site.register(ELListedComscfd, ELListedComscfdAdmin)
# admin.site.register(ELListedComscfi, ELListedComscfiAdmin)
# admin.site.register(ELListedXinsan, ELListedXinsanAdmin)
admin.site.register(ELNacao, ELNacaoAdmin)
